<html style="overflow-x:auto;overflow-y:auto;"><head>
    <title>订单模块管理 - Powered By 智能数据</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"><meta name="author" content="http://jeesite.com/">
    <meta name="renderer" content="webkit"><meta http-equiv="X-UA-Compatible" content="IE=8,IE=9,IE=10">
    <meta http-equiv="Expires" content="0"><meta http-equiv="Cache-Control" content="no-cache"><meta http-equiv="Cache-Control" content="no-store">
    <script src="http://mis.ultradata.cn/DSP/static/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
    <link href="http://mis.ultradata.cn/DSP/static/bootstrap/2.3.1/css_default/bootstrap_new.css" type="text/css" rel="stylesheet">
    <link href="http://mis.ultradata.cn/DSP/static/bootstrap/2.3.1/css_default/dsp-style_new.css" type="text/css" rel="stylesheet">

    <script src="http://mis.ultradata.cn/DSP/static/bootstrap/2.3.1/js/bootstrap.min.js" type="text/javascript"></script>
    <link href="http://mis.ultradata.cn/DSP/static/bootstrap/2.3.1/awesome/font-awesome.min.css" type="text/css" rel="stylesheet">
    <!--[if lte IE 7]><link href="http://mis.ultradata.cn/DSP/static/bootstrap/2.3.1/awesome/font-awesome-ie7.min.css" type="text/css" rel="stylesheet" /><![endif]-->
    <!--[if lte IE 6]><link href="http://mis.ultradata.cn/DSP/static/bootstrap/bsie/css/bootstrap-ie6.min.css" type="text/css" rel="stylesheet" />
<script src="http://mis.ultradata.cn/DSP/static/bootstrap/bsie/js/bootstrap-ie.min.js" type="text/javascript"></script><![endif]-->
    <link href="http://mis.ultradata.cn/DSP/static/jquery-select2/3.4/select2.css" rel="stylesheet">
    <script src="http://mis.ultradata.cn/DSP/static/jquery-select2/3.4/select2.min.js" type="text/javascript"></script>
    <link href="http://mis.ultradata.cn/DSP/static/jquery-validation/1.11.0/jquery.validate.min.css" type="text/css" rel="stylesheet">
    <script src="http://mis.ultradata.cn/DSP/static/jquery-validation/1.11.0/jquery.validate.js" type="text/javascript"></script>
    <link href="http://mis.ultradata.cn/DSP/static/jquery-jbox/2.3/Skins/Bootstrap/jbox.css" rel="stylesheet">
    <script src="http://mis.ultradata.cn/DSP/static/jquery-jbox/2.3/jquery.jBox-2.3.min.js" type="text/javascript"></script>
    <script src="http://mis.ultradata.cn/DSP/static/My97DatePicker/WdatePicker.js" type="text/javascript"></script><link href="http://mis.ultradata.cn/DSP/static/My97DatePicker/skin/WdatePicker.css" rel="stylesheet" type="text/css">
    <script src="http://mis.ultradata.cn/DSP/static/common/mustache.min.js" type="text/javascript"></script>
    <link href="http://mis.ultradata.cn/DSP/static/common/jeesite.css" type="text/css" rel="stylesheet">
    <script src="http://mis.ultradata.cn/DSP/static/common/jeesite.js" type="text/javascript"></script>
    <script type="text/javascript">var ctx = '/DSP', ctxStatic='/DSP/static';</script>
    <link rel="icon" type="image/x-icon" href="http://mis.ultradata.cn/DSP/static/favicon.ico">
    <!-- 自定义时间kongjian -->
    <link href="http://mis.ultradata.cn/DSP/static/common/daterangepicker-bs3.css" type="text/css" rel="stylesheet">
    <link href="http://mis.ultradata.cn/DSP/static/common/daterangepicker-1.3.7.css" type="text/css" rel="stylesheet">
    <script src="http://mis.ultradata.cn/DSP/static/common/moment.js" type="text/javascript"></script>
    <script src="http://mis.ultradata.cn/DSP/static/common/daterangepicker-1.3.7.js" type="text/javascript"></script>
    <script src="http://mis.ultradata.cn/DSP/static/common/dateList.js" type="text/javascript"></script>


    <meta name="decorator" content="default">
    <style type="text/css">
        .input-group{
            display:none;
        }
        .frequencyNum-freq-text{
            width:50px;
        }

        .frequencyNum-budget-text{
            width:100px;
        }

        .frequencyNum-profit-text{
            width:100px;
        }

        .input-td-pos{
            position: relative;
        }

        .pointer{
            cursor:pointer;
        }

        .input-group-freq-pos{
            width: 350px;
        }
    </style>
    <script type="text/javascript">
        function page(n,s){
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
        $(function() {
            $(".rowCellEdit").click(function(){
                var _this=$(this);
                _this.parent().hide();
                $('#contentTable').find('.input-group-pos').hide();
                $('#contentTable').find('.input-group-pos').prev().show();
                _this.parent().next().show();
                if(_this.parent().next().find('input.frequencyNum-freq-text')){
                    _this.parent().next().find('input.frequencyNum-freq-text').val(_this.parent().find('.orderNum').text());
                }
                if(_this.parent().next().find('input.frequencyNum-budget-text')){
                    _this.parent().next().find('input.frequencyNum-budget-text').val(_this.parent().find('.orderNum').text());
                }
            });
            //编辑 取消
            $(".input-group-remove").click(function(){
                var _this=$(this);
                _this.parent().hide();
                _this.parent().prev().show();
                _this.parent().find('.tip-danger').remove();
            });

            $("#contentTable .input-group-submit1").click(function(){
                var notNum='<p class="tip-danger mt10">请输入正整数或者小数点后两位的浮点数！</p>';
                var reg=/^(\d|([1-9]\d+))(\.\d{1,2})?$/;
                var regTimes=/^(0|[1-9][0-9]*)$/;
                var orderProfit=$(this).parent().find('.frequencyNum-profit-text').val();

                $(this).parent().find('.tip-danger').remove();
                if($(this).parent().find('input[type="text"]').hasClass('frequencyNum-profit-text')){
                    if(orderProfit==''){
                    }else if(reg.test(orderProfit)==false){
                        $(this).parent().find('.frequencyNum-profit-text').val('');
                        $(this).parent().append(notNum);
                        return false;
                    }

                }
                var id = $(this).parent().find('.input').val();
                var bidRate = orderProfit;
                $.ajax({
                    url:ctx+'/order/dspOrder/bidRateUpdate',
                    data:{'id':id,'bidRate':bidRate},
                    type:'post',
                    dataType:'json',
                    success:function(data){
                        location.reload();
                    }
                });
                $(this).parent().hide();
                $(this).parent().prev().show();
            });
            //编辑 提交
            $("#contentTable .input-group-submit").click(function(){
                var tipEmpty='<p class="tip-danger mt10">数值不能为空，请输入正确的数值！</p>';
                var notNum='<p class="tip-danger mt10">请输入正整数或者小数点后两位的浮点数！</p>';
                var freqNum='<p class="tip-danger mt10">请输入正整数！</p>';
                var reg=/^(\d|([1-9]\d+))(\.\d{1,2})?$/;
                var regTimes=/^(0|[1-9][0-9]*)$/;
                var orderProfit=$(this).parent().find('.frequencyNum-profit-text').val();
                var orderMoney=$(this).parent().find('.frequencyNum-budget-text').val();
                var orderTimes=$(this).parent().find('.frequencyNum-freq-text').val();

                $(this).parent().find('.tip-danger').remove();
                if($(this).parent().find('input[type="text"]').hasClass('frequencyNum-profit-text')){
                    if(orderProfit==''){

                    }else if(reg.test(orderProfit)==false){
                        $(this).parent().find('.frequencyNum-profit-text').val('');
                        $(this).parent().append(notNum);
                        return false;
                    }

                }
                if($(this).parent().find('input[type="text"]').hasClass('frequencyNum-budget-text')){
                    if(orderMoney==''){
                        $(this).parent().append(tipEmpty);
                        return false;
                    }

                    if(reg.test(orderMoney)==false){
                        $(this).parent().find('.frequencyNum-budget-text').val('');
                        $(this).parent().append(notNum);
                        return false;
                    }
                }

                if($(this).parent().find('input[type="text"]').hasClass('frequencyNum-freq-text')){
                    if(orderTimes==''){
                        $(this).parent().append(tipEmpty);
                        return false;
                    }

                    if(regTimes.test(orderTimes)==false){
                        $(this).parent().find('.frequencyNum-freq-text').val('');
                        $(this).parent().append(freqNum);
                        return false;
                    }
                }

                var strObj="{";
                $(this).parent().find('.input').each(function(){
                    if($(this).is('input[type="hidden"]')||$(this).is('input[type="text"]')){
                        var a=$(this).val();
                        var b=$(this).attr('name');
                        strObj+="'"+b+"' :'"+a+"',";
                        //console.log(b+":"+a);
                    }
                    if($(this).is('input[type="radio"]:checked')){
                        var b1=$(this).attr('name');
                        var a1=$(this).val();
                        strObj+="'"+b1+"' :'"+a1+"',";
                        //console.log(b1+":"+a1);
                    }
                    if($(this).is('select')){
                        var b2=$(this).attr('name');
                        var a2=$(this).val();
                        strObj+="'"+b2+"' :'"+a2+"',";
                    }
                });
                strObj=strObj.substr(0,strObj.length-1);
                strObj+="}";
                var obj= eval('(' + strObj + ')');
                $.ajax({
                    url:ctx+'/order/dspOrder/singleUpdate',
                    data:obj,
                    type:'post',
                    dataType:'json',
                    success:function(data){
                        location.reload();
                    }
                });

                $(this).parent().hide();
                $(this).parent().prev().show();

            });

            $('.frequencyNum-budget-text').focus(function(){
                var _this=$(this);
                _this.parent().find('.tip-danger').remove();
            });

            $('.frequencyNum-freq-text').focus(function(){
                var _this=$(this);
                _this.parent().find('.tip-danger').remove();
            });

            var tipPlan='<div class="alert alert-danger planId-tip">'
                +'<button data-dismiss="alert" class="close">×</button>'
                +'<span>活动编号超过50项，请重新填写!</span>'
                +'</div>';

            var tipOrder='<div class="alert alert-danger order-tip">'
                +'<button data-dismiss="alert" class="close">×</button>'
                +'<span>订单编号超过50项，请重新填写!</span>'
                +'</div>';

            $('input[name="orderIds"]').focus(function(){
                $('.nothing').remove();
                $('.order-tip').remove();
            });

            $("input[name='orderIds']").blur(function(){
                var orderIds = $("#orderIds").val().trim().replace(/\s/g,"").replace(/，/ig,',');
                var str = orderIds.split(",");

                if(orderIds.indexOf(",") > 0&&str.length>50){
                    $('#subtips').append(tipOrder);
                    setTimeout(function(){
                        $('.order-tip').remove();
                    },3000);
                }
            });

            $('input[name="planIds"]').focus(function(){
                $('.nothing').remove();
                $('.planId-tip').remove();
            });

            $("input[name='planIds']").blur(function(){
                var planIds = $("#planIds").val().trim().replace(/\s/g,"").replace(/，/ig,',');
                var str = planIds.split(",");

                if(planIds.indexOf(",") > 0&&str.length>50){
                    $('#subtips').append(tipPlan);
                    setTimeout(function(){
                        $('.planId-tip').remove();
                    },3000);
                }
            });

        });

        function exchange(preci,id,ithis){
            $('#order-modal').modal('show');
            $('#order-status').unbind('click').click(function(){
                $('#order-modal').modal('hide');
                changeStatus(preci,id,ithis);
            });
        }

        function changeStatus(preci,id,ithis){
            if($(ithis).hasClass('plan-state-start')){
                bidStatus='2';
            }else{
                bidStatus='1';
            }
            $.ajax({
                url:'/DSP/order/dspOrder/updateBidStatus',
                data:{'preci':preci,'id':id,'bidStatus':bidStatus},
                type:'post',
                success:function(data){
                    if(data=="disable"){
                        var tips='<div class="alert alert-danger order-tip">'
                            +'<button data-dismiss="alert" class="close">×</button>'
                            +'<span>该订单所属活动已经被禁用，您不能变更竞价状态!</span>'
                            +'</div>';

                        $('#subtips').append(tips);
                        setTimeout(function(){
                            $('#subtips').children().remove();
                        },3000);
                    }else{
                        location.reload();
                    }
                }
            });
        }
    </script>

</head><style type="text/css" id="859369706170"></style>
<body>


<div class=" clearfix">
    <button class="btn btn-primary btn-sm" type="button" onclick="window.location.reload();"><span class="icon icon-refresh"></span> 刷新</button>
    <!-- <div id="reportrange" class="span3 dateRange pull-right timeList mBottom15">
        <span id="searchDateRange"></span>
        <b class="caret"></b>
    </div> -->
</div>
<div class="breadcrumb">
    <div class="order-form-search clearfix">
        <div class="order-add-btn  btn-group pull-left">
            <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                创建订单<span class="caret"></span>
            </button>
            <ul class="dropdown-menu">
                <li><a href="/DSP/order/dspOrder/form?type=native">新建Native订单</a></li>
                <li><a href="/DSP/order/dspOrder/form?type=banner">新建Banner订单</a></li>
                <li><a href="/DSP/plan/dspPlan/form">新建活动</a></li>
            </ul>
        </div>
        <div class="pull-left" style="margin-left: 5px">
            <form id="searchForm" class=" form-search" action="/DSP/order/dspOrder/" method="post">
                <input id="pageNo" name="pageNo" type="hidden" value="1">
                <input id="pageSize" name="pageSize" type="hidden" value="30">
                <ul class="ul-form order-search-list clearfix">
                    <li><label>广告主名称：</label>
                        <div class="select2-container input-large select2-dropdown-open select2-container-active" id="s2id_memberId"><a href="javascript:void(0)" onclick="return false;" class="select2-choice" tabindex="-1">   <span class="select2-chosen">请选择广告主</span><abbr class="select2-search-choice-close"></abbr>   <span class="select2-arrow"><b></b></span></a><input class="select2-focusser select2-offscreen" type="text" id="s2id_autogen1" disabled=""></div><select id="memberId" name="memberId" class="input-large select2-offscreen" tabindex="-1">
                            <option value="">请选择广告主</option>

                            <option value="m_376">广告公司测试名称</option>

                        </select>
                    </li>
                    <li><label>活动名称：</label>
                        <div class="select2-container input-large" id="s2id_planId"><a href="javascript:void(0)" onclick="return false;" class="select2-choice" tabindex="-1">   <span class="select2-chosen">请选择活动</span><abbr class="select2-search-choice-close"></abbr>   <span class="select2-arrow"><b></b></span></a><input class="select2-focusser select2-offscreen" type="text" id="s2id_autogen2"><div class="select2-drop select2-display-none select2-with-searchbox">   <div class="select2-search">       <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input">   </div>   <ul class="select2-results">   </ul></div></div><select id="planId" name="planId" class="input-large select2-offscreen" tabindex="-1">
                            <option value="">请选择活动</option>

                            <option value="00522">广告活动1</option>

                        </select>
                    </li>
                    <li><label>订单名称：</label>
                        <div class="select2-container input-large" id="s2id_id"><a href="javascript:void(0)" onclick="return false;" class="select2-choice" tabindex="-1">   <span class="select2-chosen">请选择订单</span><abbr class="select2-search-choice-close"></abbr>   <span class="select2-arrow"><b></b></span></a><input class="select2-focusser select2-offscreen" type="text" id="s2id_autogen3"><div class="select2-drop select2-display-none select2-with-searchbox">   <div class="select2-search">       <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input">   </div>   <ul class="select2-results">   </ul></div></div><select name="id" id="id" class="input-large select2-offscreen" tabindex="-1">
                            <option value="">请选择订单</option>

                            <option value="0000883">订单3</option>

                            <option value="0000882">订单2</option>

                            <option value="0000881">订单1</option>

                        </select>
                    </li>
                    <li><label>订单编号：</label>
                        <input id="orderIds" name="orderIds" class="input-medium" type="text" value="">
                    </li>
                    <li><label>活动编号：</label>
                        <input id="planIds" name="planIds" class="input-medium" type="text" value="">
                    </li>
                    <li><label>投放状态：</label>
                        <div class="select2-container input-xlarge controls-width" id="s2id_autogen4"><a href="javascript:void(0)" onclick="return false;" class="select2-choice" tabindex="-1">   <span class="select2-chosen">开启</span><abbr class="select2-search-choice-close"></abbr>   <span class="select2-arrow"><b></b></span></a><input class="select2-focusser select2-offscreen" type="text" id="s2id_autogen5"><div class="select2-drop select2-display-none select2-with-searchbox">   <div class="select2-search">       <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input">   </div>   <ul class="select2-results">   </ul></div></div><select name="bidStatus" class="input-xlarge controls-width select2-offscreen" tabindex="-1">
                            <option value="all">全部</option>
                            <option value="0">未投放</option>
                            <option selected="" value="1">开启</option>
                            <option value="2">暂停</option>
                        </select>
                        <button id="btnSubmit" class="btn btn-primary" type="submit"><span class="icon icon-search"></span> 查询</button>
                        <span class="ad-high-set pull-right">高级选项 <span class="icon icon-chevron-right"></span></span>
                    </li>
                </ul>
            </form>
        </div>

    </div>
    <div id="ad-high-search" class="ad-high-search hide">
        <form id="updateForm" class="form-search" action="/DSP/order/dspOrder" method="post">
            <input id="orderList" name="orderList" type="hidden">
            <ul class="ul-form">
                <li><button class="btn btn-primary order-check-all" type="button">全选</button></li>
                <li><label>订单状态：</label>
                    <div class="select2-container" id="s2id_bidStatus"><a href="javascript:void(0)" onclick="return false;" class="select2-choice" tabindex="-1">   <span class="select2-chosen">请选择</span><abbr class="select2-search-choice-close"></abbr>   <span class="select2-arrow"><b></b></span></a><input class="select2-focusser select2-offscreen" type="text" id="s2id_autogen6"><div class="select2-drop select2-display-none select2-with-searchbox">   <div class="select2-search">       <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input">   </div>   <ul class="select2-results">   </ul></div></div><select id="bidStatus" name="bidStatus" tabindex="-1" class="select2-offscreen">
                        <option value="">请选择</option>
                        <option value="1">开启</option>
                        <option value="2">暂停</option>
                    </select>
                </li>
                <li><label>订单频次：</label>
                    <input class="order-input" id="frequencyNum" type="text" name="frequencyNum" value="" maxlength="3">
                    次
                    <div class="select2-container input-xlarge controls-width" id="s2id_frequencyPrecision"><a href="javascript:void(0)" onclick="return false;" class="select2-choice" tabindex="-1">   <span class="select2-chosen">请选择</span><abbr class="select2-search-choice-close"></abbr>   <span class="select2-arrow"><b></b></span></a><input class="select2-focusser select2-offscreen" type="text" id="s2id_autogen7"><div class="select2-drop select2-display-none select2-with-searchbox">   <div class="select2-search">       <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input">   </div>   <ul class="select2-results">   </ul></div></div><select id="frequencyPrecision" name="FrequencyPrecision" class="input-xlarge controls-width  select2-offscreen" tabindex="-1">
                        <option value="" selected="selected">请选择</option>
                        <option value="day">天</option><option value="hour">小时</option>
                    </select>
                </li>
                <li>
                    <label>预算分配：</label>
                    <div class="select2-container input-xlarge controls-width" id="s2id_budgetDistributeType"><a href="javascript:void(0)" onclick="return false;" class="select2-choice" tabindex="-1">   <span class="select2-chosen">请选择</span><abbr class="select2-search-choice-close"></abbr>   <span class="select2-arrow"><b></b></span></a><input class="select2-focusser select2-offscreen" type="text" id="s2id_autogen8"><div class="select2-drop select2-display-none select2-with-searchbox">   <div class="select2-search">       <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input">   </div>   <ul class="select2-results">   </ul></div></div><select id="budgetDistributeType" name="budgetDistributeType" class="input-xlarge controls-width select2-offscreen" tabindex="-1">
                    <option value="" selected="selected">请选择</option>
                    <option value="fast">加速</option><option value="avg">匀速</option>
                </select>
                    <input class="order-input" id="budgetDistributeVal" name="budgetDistributeVal" type="text" value="" maxlength="6">
                    <div class="select2-container input-xlarge controls-width" id="s2id_budgetDistributeUnitType"><a href="javascript:void(0)" onclick="return false;" class="select2-choice" tabindex="-1">   <span class="select2-chosen">请选择</span><abbr class="select2-search-choice-close"></abbr>   <span class="select2-arrow"><b></b></span></a><input class="select2-focusser select2-offscreen" type="text" id="s2id_autogen9"><div class="select2-drop select2-display-none select2-with-searchbox">   <div class="select2-search">       <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input">   </div>   <ul class="select2-results">   </ul></div></div><select id="budgetDistributeUnitType" name="budgetDistributeUnitType" class="input-xlarge controls-width  select2-offscreen" tabindex="-1">
                    <option value="" selected="selected">请选择</option>
                    <option value="day">天</option><option value="hour">小时</option>
                </select>
                </li>
                <li><label>出价：</label>
                    <input class="order-input" id="bid" type="text" name="bid" value="" maxlength="6"></li>
                <li><button type="button" class="btn btn-primary order-search-btn" id="batch-save">批量保存</button></li>
            </ul>
        </form>
    </div>
</div>
<div id="subtips"></div>














<script type="text/javascript">top.$.jBox.closeTip();</script>

<div>
    <table id="contentTable" class="table table-striped table-bordered table-condensed plan-table-select">
        <thead>
        <tr>
            <th></th>
            <th>状态</th>
            <th>订单编号</th>
            <th>订单名称</th>


            <th>出价（元）</th>


            <th>出价（元）</th>


            <th>预算（元）</th>
            <th>频次</th>




            <th>花费</th>


            <th>盈利</th>


            <th>花费</th>

            <!-- <th>订单花费（元）</th> -->
            <!-- <th>分钟花费（元）</th> -->
            <th>竞得率（%）</th>
            <th>CPC（元）</th>
            <th>CPM（元）</th>
            <th>曝光数（次）</th>
            <th>点击数（次）</th>
            <th>转化量（次）</th>
            <th>转化成本（元）</th>

        </tr>
        </thead>
        <tbody>

        <tr>
            <td><input name="Fruit" type="checkbox" value="0000883"></td>
            <td>



                <span class="plan-state  plan-state-start" onclick="exchange('order','0000883',this)"></span>




            </td>
            <td>
                0000883
            </td>
            <td>
                <a href="/DSP/order/dspOrder/editform?id=0000883">订单3</a>
            </td>
            <!-- 				<td class="input-td-pos"> -->
            <!-- 					<div> -->

            <!-- 							<span class="icon-edit  pointer  rowCellEdit" ></span> -->


            <!-- 					</div> -->
            <!-- 					<div  class="input-group input-group-pos" > -->


            <!-- 						&nbsp;&nbsp; -->
            <!-- 						<span class="icon icon-remove input-group-remove pointer" ></span> -->
            <!-- 						| -->
            <!-- 						<span class="icon icon-ok pointer input-group-submit"></span> -->
            <!-- 					</div> -->
            <!-- 				</td> -->


            <td class="input-td-pos">
                <div>

                    <span class="icon-edit  pointer  rowCellEdit"></span>

                    <span class="orderNum"></span>
                </div>
                <div class="input-group input-group-pos">
                    <input name="bit" class="input" type="hidden" value="2">
                    <input name="id" class="input" type="hidden" value="0000883">
                    <input name="agencyBid" class="frequencyNum-budget-text  input" type="text" maxlength="6" size="10" value="">
                    &nbsp;&nbsp;
                    <span class="icon icon-ok pointer input-group-submit"></span>
                    |
                    <span class="icon icon-remove input-group-remove pointer"></span>
                </div>
            </td>


            <td class="input-td-pos">
                <div>

                    <span class="orderNum"></span>
                </div>
                <div class="input-group input-group-pos">
                    <input name="bit" class="input" type="hidden" value="3">
                    <input name="id" class="input" type="hidden" value="0000883">
                    <input name="memberBid" class="frequencyNum-budget-text  input" type="text" maxlength="6" size="10" value="">
                    &nbsp;&nbsp;
                    <span class="icon icon-ok pointer input-group-submit"></span>
                    |
                    <span class="icon icon-remove input-group-remove pointer"></span>
                </div>
            </td>


            <td class="input-td-pos">
                <div>
                    <span class="icon-edit pointer  rowCellEdit"></span>
                    <span class="orderNum">3.0</span>
                    小时/
                    匀速
                </div>
                <div class="input-group  input-group-pos input-group-freq-pos">
                    <input name="id" class="input" type="hidden" value="0000883">
                    <input name="budgetDistributeVal" class="frequencyNum-budget-text input" type="text" maxlength="6" size="10" value="3.0">
                    <div class="select2-container input" id="s2id_autogen10"><a href="javascript:void(0)" onclick="return false;" class="select2-choice" tabindex="-1">   <span class="select2-chosen">匀速</span><abbr class="select2-search-choice-close"></abbr>   <span class="select2-arrow"><b></b></span></a><input class="select2-focusser select2-offscreen" type="text" id="s2id_autogen11"><div class="select2-drop select2-display-none select2-with-searchbox">   <div class="select2-search">       <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input">   </div>   <ul class="select2-results">   </ul></div></div><select name="budgetDistributeType" class="input select2-offscreen" tabindex="-1">
                    <option value="avg" selected="selected">匀速</option>
                    <option value="fast">加速</option>
                </select>
                    /
                    <div class="select2-container input" id="s2id_autogen12"><a href="javascript:void(0)" onclick="return false;" class="select2-choice" tabindex="-1">   <span class="select2-chosen">小时</span><abbr class="select2-search-choice-close"></abbr>   <span class="select2-arrow"><b></b></span></a><input class="select2-focusser select2-offscreen" type="text" id="s2id_autogen13"><div class="select2-drop select2-display-none select2-with-searchbox">   <div class="select2-search">       <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input">   </div>   <ul class="select2-results">   </ul></div></div><select name="budgetDistributeUnitType" class="input select2-offscreen" tabindex="-1">
                    <option value="hour" selected="selected">小时</option>
                    <option value="day">天</option>
                </select>
                    &nbsp;&nbsp;
                    <span class="icon icon-ok pointer input-group-submit"></span>|
                    <span class="icon icon-remove input-group-remove pointer"></span>
                </div>
            </td>
            <td class="input-td-pos">
                <div>
                    <span class="icon-edit pointer  rowCellEdit"></span>
                    <span class="orderNum">30</span> 次/
                    天
                </div>
                <div class="input-group  input-group-pos">
                    <input name="id" class="input" type="hidden" value="0000883">
                    <input name="frequencyNum" class="frequencyNum-freq-text input" type="text" maxlength="3" size="10" value="30">
                    /
                    <div class="select2-container input" id="s2id_autogen14"><a href="javascript:void(0)" onclick="return false;" class="select2-choice" tabindex="-1">   <span class="select2-chosen">天</span><abbr class="select2-search-choice-close"></abbr>   <span class="select2-arrow"><b></b></span></a><input class="select2-focusser select2-offscreen" type="text" id="s2id_autogen15"><div class="select2-drop select2-display-none select2-with-searchbox">   <div class="select2-search">       <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input">   </div>   <ul class="select2-results">   </ul></div></div><select name="frequencyPrecision" class="input select2-offscreen" tabindex="-1">
                    <option value="hour">小时</option>
                    <option value="day" selected="selected">天</option>
                </select>
                    &nbsp;&nbsp;
                    <span class="icon icon-ok pointer input-group-submit"></span>|
                    <span class="icon icon-remove input-group-remove pointer"></span>
                </div>
            </td>




            <td>
                0.00
            </td>


            <td>
                0.00
            </td>


            <td>
                0.00
            </td>

            <td>
                0.00
            </td>
            <td>
                0.00
            </td>
            <td>
                0.00
            </td>
            <td>
                0.00
            </td>
            <td>
                0.00
            </td>
            <td>
                0.00
            </td>
            <td>
                0.00
            </td>

        </tr>

        </tbody>
    </table>
    <div class="pagination"><ul>
        <li class="disabled"><a href="javascript:">« 上一页</a></li>
        <li class="active"><a href="javascript:">1</a></li>
        <li class="disabled"><a href="javascript:">下一页 »</a></li>
        <li class="disabled controls"><a href="javascript:">当前第<input readonly="true" type="text" value="1" onkeypress="var e=window.event||this;var c=e.keyCode||e.which;if(c==13)page(this.value,30,'');" onclick="this.select();"> 页 每页<input readonly="true" type="text" value="30" onkeypress="var e=window.event||this;var c=e.keyCode||e.which;if(c==13)page(1,this.value,'');" onclick="this.select();"> 条，共 1 条</a></li>
    </ul>
        <div style="clear:both;"></div></div>
    <!-- Modal -->
    <div class="modal hide" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" onclick="cancelCode('data-code-list')" aria-label="Close"><span aria-hidden="true">×</span></button>
                    <h4 class="modal-title">提示信息</h4>
                </div>
                <div class="modal-body">
                    <p class="tip-danger">确定要批量修改订单吗？</p>
                </div>
                <div class="modal-footer">
                    <button id="data-sure" type="button" class="btn btn-primary">确定</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>

    <div class="modal hide" id="order-modal" tabindex="-2" role="dialog" aria-labelledby="order-modal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" onclick="cancelCode('data-code-list')" aria-label="Close"><span aria-hidden="true">×</span></button>
                    <h4 class="modal-title">提示信息</h4>
                </div>
                <div class="modal-body">
                    <p class="tip-danger">确定要修改当前订单状态吗？</p>
                </div>
                <div class="modal-footer">
                    <button id="order-status" type="button" class="btn btn-primary">确定</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>

    <div class="modal hide" id="offOrder-modal" tabindex="-3" role="dialog" aria-labelledby="offOrder-modal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" onclick="cancelCode('data-code-list')" aria-label="Close"><span aria-hidden="true">×</span></button>
                    <h4 class="modal-title">提示信息</h4>
                </div>
                <div class="modal-body">
                    <p class="tip-danger"></p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </div>
        </div>
    </div>
    <script>
        function removeTip(){
            setTimeout(function(){
                $('.alert-tip').remove();
            },3000);
        }
        function batchUpdate(){
            var $form = $('#updateForm'); // 很关键
            // 得到 form 的提交路径
            url = '/DSP/order/dspOrder/batchUpdate'; // 得到该 form 的提交路径,并赋值到 url
            // 以 post 方式提交, 回调函数function 返回 data
            var i = $.post(url, $form.serialize(), function(data)
            {
                if(data!=''){
                    var str=data.substring(0,data.length-1);
                    var tipHtml='批量修改中订单编号为'+str+'为禁用订单，未能修改！';
                    $('#offOrder-modal .tip-danger').html(tipHtml);
                    $('#myModal').modal('hide');
                    $('#offOrder-modal').modal('show');

                    $('#offOrder-sure').click(function(){
                        $('#offOrder-modal').modal('hide');
                        location.reload();
                    });

                    $('#offOrder-modal').on('hidden.bs.modal', function (e) {
                        location.reload();
                    });
                }else{
                    location.reload();
                }

            });

        }
        $(function(){
            $('.ad-high-set').click(function(){ //高级选项文字点击
                var _this=$(this);
                if($('#ad-high-search').hasClass('hide')){ //判断他的下一个元素是否含有hide class
                    _this.addClass('ad-high-setborder'); //添加边框class
                    $('#ad-high-search').removeClass('hide');//移除hide class
                    _this.children().addClass('icon-chevron-down').removeClass('icon-chevron-right'); //改变箭头方向class
                }else{
                    _this.removeClass('ad-high-setborder');//移除边框class
                    $('#ad-high-search').addClass('hide');//添加hide class
                    _this.children().addClass('icon-chevron-right').removeClass('icon-chevron-down'); //改变箭头方向class
                }
            });

            $('.order-check-all').click(function(){ //全选点击
                var _this=$(this);
                var str='';
                var _table=$('#contentTable');
                if(_this.hasClass('order-checked-all')){ //判断是否含有全选的class
                    _this.removeClass('order-checked-all'); //移除全选class
                    _table.find('input[name="Fruit"]').attr('checked',false);//设置table的checkbox 为false
                    $('#orderList').val(''); //清空隐藏域的值
                }else{
                    _this.addClass('order-checked-all'); //添加全选class
                    _table.find('input[name="Fruit"]').attr('checked',true); //设置table中的checkbox 为true
                    _table.find('input[name="Fruit"]').each(function(){ //循环取得所有的订单ID
                        var _this=$(this);
                        str+=_this.val()+',';
                    });
                    str=str.substring(0,str.length-1); //去掉最后一个都好
                    $('#orderList').val(str); //给隐藏域赋值
                }
            });
            $('#contentTable input[name="Fruit"]').click(function(){ //单选点击
                var _this=$(this);
                var str='';
                var arr=[];
                var _table=$('#contentTable');
                if(_this.is(':checked')){ //判断是否选中
                    _this.attr('checked',true);
                    _table.find('input[name="Fruit"]:checked').each(function(){ //循环取得所有的val值
                        var _this=$(this);
                        str+=_this.val()+',';
                    });
                    str=str.substring(0,str.length-1); //去掉最后一个逗号
                    $('#orderList').val(str); //给隐藏域赋值
                }else{
                    _this.attr('checked',false);
                    arr = $('#orderList').val().split(','); //分割隐藏域的值
                    for(var i=0;i<arr.length;i++){ //循环匹配数组中是否含有当前的值
                        if(_this.val()==arr[i]){
                            continue;//有，跳过
                        }else{
                            str +=arr[i]+',';
                        }
                    }
                    str=str.substring(0,str.length-1);//去掉最后一个逗号
                    $('#orderList').val(str);
                }
            });

            /*  优化项
             //广告主、活动、订单
             function objInit(obj){
             return $(obj).html('<option>请选择</option>');
             }
             var arrData="";
             $.ajax({
             url:'/DSP/order/dspOrder/search',
             type:'post',
             async : false,
             dataType: 'json',
             error:function(){
             alert('error');
             },
             success:function(data){
             arrData = data;
             }
             });

             $.each(arrData,function(pF){
             $('#memberId').append('<option>'+pF+'</option>');
             });
             $('#memberId').change(function(){
             //objInit('#planId');
             //objInit('#id');
             $.each(arrData,function(pF,pS){
             if($('#memberId option:selected').text()==pF){
             $.each(pS,function(pT,pC){
             $('#planId').append('<option>'+pT+'</option>');
             });
             $('#planId').change(function(){
             //objInit('#id');
             $.each(pS,function(pT,pC){
             if($('#planId option:selected').text()==pT){
             $.each(pC.split(","),function(){
             $('#id').append('<option>'+this+'</option>');
             })
             }
             })

             });
             }
             });
             }); */

            /********* 高级选项设置 验证 二次弹出框确定 start ************/
            $('.order-input').focus(function(){
                $('.alert-tip').remove();
            });

            $('.order-input').blur(function(){
                var _this=$(this);
                var reg=/^(0|\+?[1-9][0-9]*)$/;
                var bugetReg=/^(\d|([1-9]\d+))(\.\d{1,2})?$/;
                var str=_this.val();
                var _alert='<div class="alert alert-danger alert-tip mt10">'
                    +'<button data-dismiss="alert" class="close">×</button>'
                    +'<span>只能输入数字，请重新输入数值！</span>'
                    +'</div>';
                var _alert2='<div class="alert alert-danger alert-tip mt10">'
                    +'<button data-dismiss="alert" class="close">×</button>'
                    +'<span>订单频次请输入不已0开始的正整数!</span>'
                    +'</div>';

                var _alert3='<div class="alert alert-danger alert-tip mt10">'
                    +'<button data-dismiss="alert" class="close">×</button>'
                    +'<span>每日预算请输入不以0开始的整数,小数点后只保留两位小数!</span>'
                    +'</div>';

                var _alert4='<div class="alert alert-danger alert-tip mt10">'
                    +'<button data-dismiss="alert" class="close">×</button>'
                    +'<span>出价请输入不以0开始的整数,小数点后只保留两位小数!</span>'
                    +'</div>';
                var _alert5='<div class="alert alert-danger alert-tip mt10">'
                    +'<button data-dismiss="alert" class="close">×</button>'
                    +'<span>订单频次数值不能为空!</span>'
                    +'</div>';
                var _alert6='<div class="alert alert-danger alert-tip mt10">'
                    +'<button data-dismiss="alert" class="close">×</button>'
                    +'<span>预算分配数值不能为空!</span>'
                    +'</div>';
                var _alert7='<div class="alert alert-danger alert-tip mt10">'
                    +'<button data-dismiss="alert" class="close">×</button>'
                    +'<span>出价不能为空!</span>'
                    +'</div>';


                removeTip();
                if(isNaN(str)==true){
                    _this.val('');
                    $('.breadcrumb').append(_alert);
                    return false;
                }

                if(_this.attr('name')=='frequencyNum'){
                    if(_this.val()==''){
                        $('.breadcrumb').append(_alert5);
                        return false;
                    }
                    if(!reg.test(str)){
                        _this.val('');
                        $('.breadcrumb').append(_alert2);
                    }
                }

                if(_this.attr('name')=='budgetDistributeVal'){
                    if(_this.val()==''){
                        $('.breadcrumb').append(_alert6);
                        return false;
                    }
                    if(!bugetReg.test(str)){
                        _this.val('');
                        $('.breadcrumb').append(_alert3);
                    }
                }


                if(_this.attr('name')=='bid'){
                    if(_this.val()==''){
                        $('.breadcrumb').append(_alert7);
                        return false;
                    }
                    if(!bugetReg.test(str)){
                        _this.val('');
                        $('.breadcrumb').append(_alert4);
                    }
                }

            });

            $('#batch-save').click(function(){
                var str=$('#orderList').val();
                var _alert='<div class="alert alert-danger alert-tip mt10">'
                    +'<button data-dismiss="alert" class="close">×</button>'
                    +'<span>请选择表格中的任意一个订单！</span>'
                    +'</div>';
                var _alert2='<div class="alert alert-danger alert-tip mt10">'
                    +'<button data-dismiss="alert" class="close">×</button>'
                    +'<span>订单频次修改时请选择时间控制！</span>'
                    +'</div>';
                var _alert21='<div class="alert alert-danger alert-tip mt10">'
                    +'<button data-dismiss="alert" class="close">×</button>'
                    +'<span>订单频次修改时请输入频次！</span>'
                    +'</div>';
                var _alert3='<div class="alert alert-danger alert-tip mt10">'
                    +'<button data-dismiss="alert" class="close">×</button>'
                    +'<span>预算分配修改时请修改完整！</span>'
                    +'</div>';

                var _alert4='<div class="alert alert-danger alert-tip mt10">'
                    +'<button data-dismiss="alert" class="close">×</button>'
                    +'<span>请最少选择一个修改项！</span>'
                    +'</div>';
                var optionVal=$('#frequencyPrecision option:selected').val();

                var bidStatus=$("#bidStatus option:selected").val();
                var frequencyPrecision=$("#frequencyPrecision option:selected").val();
                var budgetDistributeType=$("#budgetDistributeType option:selected").val();
                var budgetDistributeUnitType=$("#budgetDistributeUnitType option:selected").val();

                $('.alert-tip').remove();

                removeTip();
                if(str==''){
                    $('.breadcrumb').append(_alert);
                    return false;
                }

                if($('#frequencyNum').val()!='' || optionVal!=''){
                    if(optionVal==''){
                        $('.breadcrumb').append(_alert2);
                        return false;
                    }
                    if($('#frequencyNum').val()==''){
                        $('.breadcrumb').append(_alert21);
                        return false;
                    }

                }

                if($('#budgetDistributeVal').val() !='' || budgetDistributeType != '' || budgetDistributeUnitType != ''){
                    if(budgetDistributeUnitType == '' || budgetDistributeType == '' ){
                        $('.breadcrumb').append(_alert3);
                        return false;
                    }
                    if(budgetDistributeUnitType == '' || $('#budgetDistributeVal').val() == '' ){
                        $('.breadcrumb').append(_alert3);
                        return false;
                    }
                    if(budgetDistributeType == '' || $('#budgetDistributeVal').val() == '' ){
                        $('.breadcrumb').append(_alert3);
                        return false;
                    }
                }

                if(bidStatus =='' && $('#frequencyNum').val()==''&& frequencyPrecision =='' && budgetDistributeType =='' && $('#budgetDistributeVal').val()=='' && budgetDistributeUnitType==''&& $('#bid').val()==''){
                    $('.breadcrumb').append(_alert4);
                    return false;
                }
                removeTip();
                $('#myModal').modal('show');
            });

            $('#data-sure').click(function(){
                batchUpdate();
            });
            /********* 高级选项设置 验证 二次弹出框确定 end ************/
        });
    </script>

    <script type="text/javascript">//<!-- 无框架时，左上角显示菜单图标按钮。
    if(!(self.frameElement && self.frameElement.tagName=="IFRAME")){
        $("body").prepend("<i id=\"btnMenu\" class=\"icon-th-list\" style=\"cursor:pointer;float:right;margin:10px;\"></i><div id=\"menuContent\"></div>");
        $("#btnMenu").click(function(){
            top.$.jBox('get:/DSP/sys/menu/treeselect;JSESSIONID=b0feffe388ad43b7b239a7e455f1acad', {title:'选择菜单', buttons:{'关闭':true}, width:300, height: 350, top:10});
            //if ($("#menuContent").html()==""){$.get("/DSP/sys/menu/treeselect", function(data){$("#menuContent").html(data);});}else{$("#menuContent").toggle(100);}
        });
    }//-->
    </script>

</div><div id="select2-drop-mask" class="select2-drop-mask" style=""></div><div class="select2-drop select2-display-none select2-with-searchbox select2-drop-active" id="select2-drop" style="left: 210px; width: 210px; top: 74px; bottom: auto; display: block;">   <div class="select2-search">       <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input">   </div>   <ul class="select2-results"><li class="select2-results-dept-0 select2-result select2-result-selectable select2-highlighted"><div class="select2-result-label"><span class="select2-match"></span>请选择广告主</div></li><li class="select2-results-dept-0 select2-result select2-result-selectable"><div class="select2-result-label"><span class="select2-match"></span>广告公司测试名称</div></li></ul></div></body></html>